﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Spellchecker
{
    internal class TextIntoWordsSplitter
    {
        // .,;!?:'\"
        public static IEnumerable<string > SplitTextIntoWords(string text)
        {
            if (text == null)
                return null;

            char[] splitAt = {   '\n', 
                                 '\r', 
                                 ' ', 
                                 '\t', 
                                 ':' , 
                                 ';' , 
                                 ',' , 
                                 '\'' , 
                                 '.' , 
                                 '\"', 
                                 '!' ,
                                 '?' };
            return text.Split(splitAt, StringSplitOptions.RemoveEmptyEntries);
        }

    }
}
